import { createStore } from "vuex";
import persistedState from "vuex-persistedstate";
let store = createStore({
  state: {
    userInfo: {},
    //验证码
    yanzm:"",
    //电话号码
    tel:"",
    //显示底部标签导航
    shownav:true,
    //是否登录状态
    islogin:false,
  },
  mutations: {
    //暂储验证码
    chanyzm(state,payload){
      state.yanzm=payload
    },
    chanphonenumber(state,payload){
      state.tel=payload
    },
    //存储登录用户数据
    setUserInfo(state, payload) {
      state.userInfo = payload;
    },
  //修改底部导航是否可见
  channav(state, payload){
    state. shownav= payload;
  }
  },
  //数据持久化
  plugins: [persistedState()],
});
export default store;